//
//  UIView+YTView.m
//  yitaicaijing
//
//  Created by DIANGHONG on 2018/7/19.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "UIView+YTView.h"
#import "UIColor+DHGradientRamp.h"
@implementation UIView (YTView)



- (void)showTipWithTipStr:(NSString *)tipStr
{
    UIWindow *window = UIApplication.sharedApplication.keyWindow;
    MBProgressHUD *hub = [MBProgressHUD showHUDAddedTo:window animated:YES];
    hub.label.text = tipStr;
    hub.mode = MBProgressHUDModeText;
    hub.bezelView.color = [UIColor colorWithHex:@"#16a5ad"];
    hub.label.font = [UIFont systemFontOfSize:15];
    hub.bezelView.alpha = 0.86;
    hub.label.textColor = UIColor.whiteColor;
    [hub hideAnimated:true afterDelay:1];
}

- (void)showAwardWithTipStr:(NSString *)tips
{
  
    UIWindow *window = UIApplication.sharedApplication.keyWindow;
    MBProgressHUD *hub = [MBProgressHUD showHUDAddedTo:window animated:YES];
    hub.label.text = tips;
    hub.mode = MBProgressHUDModeCustomView;
    hub.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ball_suanliz"]];
    hub.bezelView.color = [UIColor colorWithRed:1.0f/255.0f green:72.0f/255.0f blue:105.0f/255.0f alpha:0.65];
    hub.bezelView.alpha = 0.95;
    hub.label.textColor = UIColor.whiteColor;
    hub.label.font = [UIFont systemFontOfSize:14];
    [hub hideAnimated:true afterDelay:1];
}

- (void)showErrorWithTipStr:(NSString *)tipStr
{
    UIWindow *window = UIApplication.sharedApplication.keyWindow;
    MBProgressHUD *hub = [MBProgressHUD showHUDAddedTo:window animated:true];
    hub.label.text = tipStr;
    hub.mode = MBProgressHUDModeText;
    hub.bezelView.color = [UIColor colorWithRed:1.0f/255.0f green:72.0f/255.0f blue:105.0f/255.0f alpha:0.65];
    hub.label.textColor = UIColor.whiteColor;
    hub.label.font = [UIFont systemFontOfSize:14];
    [hub hideAnimated:true afterDelay:2];
}
@end
